import 'package:flutter/material.dart';

class Demo02singleChildLayout extends StatelessWidget {
  const Demo02singleChildLayout({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: Container(
          color: Colors.white,
          child: Center(child: const Text('Hello, World!'))),
    );
  }

  // 非MaterialApp中
  // @override
  // Widget build(BuildContext context) {
  //   // TODO: implement build
  //   return Container(
  //     decoration: const BoxDecoration(color: Colors.white),
  //     child: Center(
  //       child: const Text(
  //         'hello, world!',
  //         textDirection: TextDirection.ltr,
  //         style: TextStyle(color: Colors.black),
  //       ),
  //     ),
  //   );
  // }
}
